# -*- coding: gb2312 -*-

from StockDailyFactorGeneralFunctions import StockDailyFactorGeneralFunctions



class StockMarketValues:
    def __init__(self):
        self.baseStartDateStr = '2012-01-01'
        self.baseEndDateStr = '2017-05-01'

    def writeBaseEvToMongoDB(self):
        baseStartDateStr = self.baseStartDateStr
        baseEndDateStr = self.baseEndDateStr

        windFactorNameStr = 'ev'
        colNameStr = 'ev'
        dbUpdateDateFiledStr = 'ev_update_date'
        dbUpdateDateFieldAliasStr = ' EV '

        funcObj = StockDailyFactorGeneralFunctions()

        funcObj.writeBaseDataToMongoDB(baseStartDateStr, baseEndDateStr, windFactorNameStr, colNameStr, dbUpdateDateFiledStr, dbUpdateDateFieldAliasStr)

    def updateEvToMongoDB(self):

        windFactorNameStr = 'ev'
        colNameStr = 'ev'
        dbUpdateDateFiledStr = 'ev_update_date'
        dbUpdateDateFieldAliasStr = ' EV '

        funcObj = StockDailyFactorGeneralFunctions()

        funcObj.updateDataToMongoDB(windFactorNameStr, colNameStr, dbUpdateDateFiledStr, dbUpdateDateFieldAliasStr)

    def writeBaseMktFreeSharesToMongoDB(self):
        baseStartDateStr = self.baseStartDateStr
        baseEndDateStr = self.baseEndDateStr

        windFactorNameStr = 'mkt_freeshares'
        colNameStr = 'mkt_freeshares'
        dbUpdateDateFiledStr = 'mkt_freeshares_update_date'
        dbUpdateDateFieldAliasStr = ' market free shares '

        funcObj = StockDailyFactorGeneralFunctions()

        funcObj.writeBaseDataToMongoDB(baseStartDateStr, baseEndDateStr, windFactorNameStr, colNameStr,
                                   dbUpdateDateFiledStr, dbUpdateDateFieldAliasStr)


    def updateMktFreeSharesToMongoDB(self):

        windFactorNameStr = 'mkt_freeshares'
        colNameStr = 'mkt_freeshares'
        dbUpdateDateFiledStr = 'mkt_freeshares_update_date'
        dbUpdateDateFieldAliasStr = ' market free shares '

        funcObj = StockDailyFactorGeneralFunctions()

        funcObj.updateDataToMongoDB(windFactorNameStr, colNameStr, dbUpdateDateFiledStr, dbUpdateDateFieldAliasStr)


#obj = StockMarketValues()
#obj.writeBaseMktFreeSharesToMongoDB()
#obj.updateMktFreeSharesToMongoDB()

#obj.writeBaseEvToMongoDB()
#obj.updateEvToMongoDB()



